<template>
  <div id="app" class="container">
    <Category title="美食">
      <img slot="center" src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg" />
      <a slot="footer" href="https://www.baidu.com">更多美食</a>
    </Category>
    <Category title="电影">
      <ul slot="center">
        <li v-for="(item, index) in films" :key="index">
          {{ item }}
        </li>
      </ul>
      <div slot="footer" class="foot">
        <a href="https://www.baidu.com">更多电影</a>
        <a href="https://www.baidu.com">更多电影</a>
      </div>
    </Category>
    <Category title="游戏">
      <video
        slot="center"
        controls
        src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
      ></video>
      <!-- 通过使用template可以减少一层结构 -->
      <!-- v-slot:footer这个新语法只能用在template标签中，用在其他标签中会报错 -->
      <template v-slot:footer>
        <div class="foot">
          <a href="https://www.baidu.com">更多游戏</a>
          <a href="https://www.baidu.com">更多游戏</a>
          <a href="https://www.baidu.com">更多游戏</a>
        </div>
        <h4>欢迎来到游戏世界</h4>
      </template>
    </Category>
  </div>
</template>

<script>
import Category from "./components/Category.vue";
export default {
  components: { Category },
  name: "App",
  data() {
    return {
      foos: ["火锅", "炒菜", "米饭"],
      films: ["你好", "世界", "宇宙"],
      games: ["坦克", "飞机", "大炮"],
    };
  },
};
</script>
<style>
.container,
.foot {
  display: flex;
  justify-content: space-between;
}
img {
  width: 100%;
}
video {
  width: 100%;
}
h4{
  text-align:center;
}
</style>

